<template>
  <div>
    <van-field :name="formItem.name" :label="formItem.label">
      <template #input>
        <van-radio-group v-model="formItem.value" :direction="formItem.direction">
          <van-radio
            :name="item.name"
            :shape="item.shape"
            :key="$index"
            v-for="(item,$index) in formItem.children"
          >{{item.text}}</van-radio>
        </van-radio-group>
      </template>
    </van-field>
  </div>
</template>

<script>
/**
 * 单选框
 */
export default {
  props: {
    formItem: {
      type: Object,
      default: {
        name: "",
        label: "",
        shape:"round",
        value: "",
        direction: "",
        children: [
          {
            name: "",
            shape: "",
            text: ""
          }
        ]
      }
    }
  }
};
</script>
